package com.kyzh.core.dialog

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import androidx.appcompat.app.AlertDialog
import com.kyzh.core.R
import com.kyzh.core.databinding.DialogLoadingBinding


fun Context.showLoadingDialog(title:String):AlertDialog{
    return AlertDialog.Builder(this, R.style.kyzhGuestLoginDialog)
        .setView(getThisView(title))
        .create()
}

private fun Context.getThisView(title:String): View {
    val view = DialogLoadingBinding.inflate(LayoutInflater.from(this))
    view.apply {
        tvContent.text = title
    }
    return view.root
}
